new functions _gtk_text_btree_get_insert() and
authorYevgen Muntyan <muntyan@tamu.edu>
Thu, 15 Nov 2007 17:03:09 +0000 (17:03 +0000)
committerYevgen Muntyan <muntyan@src.gnome.org>
Thu, 15 Nov 2007 17:03:09 +0000 (17:03 +0000)
2007-11-15  Yevgen Muntyan  <muntyan@tamu.edu>

* gtk/gtktextbtree.h:
* gtk/gtktextbtree.c: new functions _gtk_text_btree_get_insert()
and _gtk_text_btree_get_selection_bound() (#497102).
* gtk/gtktextbuffer.c (gtk_text_buffer_get_insert),
(gtk_text_buffer_get_selection_bound): use them here instead of
hash table lookup.

svn path=/trunk/; revision=18996

ChangeLog
gtk/gtktextbtree.c
gtk/gtktextbtree.h
gtk/gtktextbuffer.c

index fa7141ee1a345d595beca0d1d5ef6e1f43551456..2275bc0ddba71e833b8488e4f61ddf5ce3629717 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-15  Yevgen Muntyan  <muntyan@tamu.edu>
+
+       * gtk/gtktextbtree.h:
+       * gtk/gtktextbtree.c: new functions _gtk_text_btree_get_insert()
+       and _gtk_text_btree_get_selection_bound() (#497102).
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_insert),
+       (gtk_text_buffer_get_selection_bound): use them here instead of
+       hash table lookup.
+
 2007-11-15  Yevgen Muntyan  <muntyan@tamu.edu>
 
        * gtk/gtktextbtree.c (_gtk_text_btree_get_tags): sort returned
index 9232d8c244afaed796223ecb626e54630514175a..81038f427a8bafceba0625298874306e29628a6c 100644 (file)
@@ -2972,6 +2972,18 @@ _gtk_text_btree_mark_is_selection_bound (GtkTextBTree *tree,
   return segment == tree->selection_bound_mark;
 }
 
+GtkTextMark *
+_gtk_text_btree_get_insert (GtkTextBTree *tree)
+{
+  return tree->insert_mark;
+}
+
+GtkTextMark *
+_gtk_text_btree_get_selection_bound (GtkTextBTree *tree)
+{
+  return tree->selection_bound_mark;
+}
+
 GtkTextMark*
 _gtk_text_btree_get_mark_by_name (GtkTextBTree *tree,
                                   const gchar *name)
index 053d9e1a20ee1e4a1dc1a729846f064001816dc1..627b2fc68143b1f8237333fe662b373b37a13a74 100644 (file)
@@ -200,12 +200,13 @@ void                _gtk_text_btree_place_cursor            (GtkTextBTree
                                                              const GtkTextIter  *where);
 void                _gtk_text_btree_select_range            (GtkTextBTree       *tree,
                                                              const GtkTextIter  *ins,
-                                                            const GtkTextIter 
-*bound);
+                                                            const GtkTextIter  *bound);
 gboolean            _gtk_text_btree_mark_is_insert          (GtkTextBTree       *tree,
                                                              GtkTextMark        *segment);
 gboolean            _gtk_text_btree_mark_is_selection_bound (GtkTextBTree       *tree,
                                                              GtkTextMark        *segment);
+GtkTextMark        *_gtk_text_btree_get_insert             (GtkTextBTree       *tree);
+GtkTextMark        *_gtk_text_btree_get_selection_bound            (GtkTextBTree       *tree);
 GtkTextMark        *_gtk_text_btree_get_mark_by_name        (GtkTextBTree       *tree,
                                                              const gchar        *name);
 GtkTextLine *       _gtk_text_btree_first_could_contain_tag (GtkTextBTree       *tree,
index bf4825115255783d086022de4e68b8f0581aa5cd..12f34de12797490e670859d4f8fd77afd7a415a2 100644 (file)
@@ -2296,8 +2296,7 @@ gtk_text_buffer_get_insert (GtkTextBuffer *buffer)
 {
   g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
 
-  /* FIXME use struct member in btree */
-  return gtk_text_buffer_get_mark (buffer, "insert");
+  return _gtk_text_btree_get_insert (get_btree (buffer));
 }
 
 /**
@@ -2323,8 +2322,7 @@ gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer)
 {
   g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
 
-  /* FIXME use struct member in btree */
-  return gtk_text_buffer_get_mark (buffer, "selection_bound");
+  return _gtk_text_btree_get_selection_bound (get_btree (buffer));
 }
 
 /**